<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>LZXリファレンス basedatepicker</title>
  <othercredit role="translator">
    <firstname>Atuo</firstname>
    <surname>Seki</surname>
        <contrib>2006/04/24　翻訳初版</contrib>
 </othercredit>
<link rel="STYLESHEET" type="text/css" href="./styles.css" /></head>
<body>

<!-- ===================================================================== -->
<!-- = XML information goes here                                         = -->
<!-- ===================================================================== -->
<lzelement title="Basedatepicker">
    <lztier>Base Component</lztier>
    <lzcategory>view</lzcategory>
    <lzshortdesc>
       datepickerの抽象的なクラス。
    </lzshortdesc> 
    <lztag>base/basedatepicker.xml</lztag> 
</lzelement>

<p> 
    Basedatepickerは月単位のdatapickerの機能を作成できる抽象的なクラスです。
    basedatepickerの実装する際、basedatepicker、basedatepickerday、
        およびbasedatepickerweekから関数、doSpaceUp()、doEnterUp()、そして任意の
    setMonthToShow()をdatepickerを完全な形にする為、オーバーライドされると
        予想されます。 
    datepickerのより大規模な例については、ソースコードを方をご覧ください。
        また、こちらの<a href="basedatepickerday.html"> basedatepickerday </a>
        と<a href="basedatepickerweek.html"> basedatepickerweek </a>もご覧ください。

</p>
<example class="program" id="basedatepicker-1">
&lt;canvas height="200"&gt; 
    &lt;class name="myday" 
           extends="basedatepickerday" 
           bgcolor="green"
           width="20"
           height="20"&gt;
        &lt;method event="onclick"&gt; 
        &lt;![CDATA[
            if( !this.disabled  ) {
                this.setAttribute('selected', true);    
            } 
        ]]&gt;
        &lt;/method&gt;

        &lt;text text="${parent.daynum}"
              visible="${!parent.disabled}" 
              opacity="${parent.selectable ? 1 : .3 }"/&gt;       
    &lt;/class&gt;

    &lt;class name="myweek" extends="basedatepickerweek"&gt;
        &lt;simplelayout axis="x" spacing="1"/&gt; 
    &lt;/class&gt; 
    
    &lt;class name="mydatepicker" 
           extends="basedatepicker" 
           weekclass="myweek"
           dayclass="myday"
           xinset="0"
           yinset="0"&gt;

        &lt;method name="setMonthToShow" args="month, year"&gt;
            super.setMonthToShow(month,year);
            this.display.month.datapath.setXPath(
            "datepicker_strings_en:/months/month[@index='" + month + "']/@full" );
            this.display.year.setText( year );
        &lt;/method&gt;

        &lt;method event="onselecteddate"&gt;
            if( this.selecteddate != null ) {
                this.selected.year.setText( this.selecteddate.getFullYear() );
                this.selected.month.datapath.setXPath(
                        "datepicker_strings_en:/months/month[@index='" + 
                        this.selecteddate.getMonth() + "']/@full" ); 
                this.selected.date.setText( this.selecteddate.getDate() );
            }
        &lt;/method&gt;

        &lt;view options="ignorelayout"&gt;
            &lt;text width="20" height="20" bgcolor="red" text="S"/&gt;
            &lt;text width="20" height="20" bgcolor="red" text="M"/&gt;
            &lt;text width="20" height="20" bgcolor="red" text="T"/&gt;
            &lt;text width="20" height="20" bgcolor="red" text="W"/&gt;
            &lt;text width="20" height="20" bgcolor="red" text="T"/&gt;
            &lt;text width="20" height="20" bgcolor="red" text="F"/&gt;
            &lt;text width="20" height="20" bgcolor="red" text="S"/&gt;
            &lt;simplelayout axis="x" spacing="1"/&gt;
        &lt;/view&gt; 
        &lt;view&gt; 
            &lt;button text="previous" onclick="classroot.showPreviousMonth()"/&gt;
            &lt;button text="next" onclick="classroot.showNextMonth()"/&gt;
            &lt;simplelayout axis="x"/&gt;
        &lt;/view&gt;
        &lt;view name="display"&gt;
            &lt;text&gt; Showing: &lt;/text&gt;
            &lt;text name="month" datapath="." resize="true"/&gt;
            &lt;text name="year" resize="true"/&gt;
            &lt;simplelayout axis="x" spacing="2"/&gt;
        &lt;/view&gt;
        &lt;view name="selected"&gt;
            &lt;text&gt; Selected: &lt;/text&gt;
            &lt;text name="month" datapath="." resize="true"/&gt;
            &lt;text name="date" resize="true"/&gt;
            &lt;text name="year" resize="true"/&gt;
            &lt;simplelayout axis="x" spacing="2"/&gt;
        &lt;/view&gt; 

        &lt;simplelayout axis="y" placement="content" spacing="1" inset="20"/&gt; 
        &lt;simplelayout axis="y"/&gt;
    &lt;/class&gt; 
    &lt;mydatepicker/&gt; 
&lt;/canvas&gt; 
</example>
</body>
</html>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
